package globaldata

import (
	"sync"
)

// 平台网关配置map, key是device_id，value是设备配置
// var GateWayConfigMap = make(map[string]*api.DeviceConfigResponseData)
var DeviceConfigMap sync.Map

// 设备连接map, key是设备的token，value是设备的连接
// var DeviceConnectionMap = make(map[string]*net.Conn)
var DeviceConnectionMap sync.Map

var IMEIToDeviceIDMap map[string]string

func GetConnByDeviceID(deviceID string) (any, bool) {
	value, ok := DeviceConnectionMap.Load(deviceID)
	if !ok {
		return nil, false
	}
	return value, true
}
